package com.sdsy.util;

import java.io.Serializable;
import java.util.List;

public class PageResult implements Serializable {
	private static final long serialVersionUID = 1L;
	private int pageIndex; // 当前页号
	private int totalPages; // 总页数
	private int total; // 总页数
	private boolean hasNextPage = true; //是否还有下一页
	private List<?> rows;
	
	public PageResult(List<?> rows, PageFormatHelper pageFormat){
		this.total = pageFormat.getTotalRows();
		this.totalPages = pageFormat.getTotalPages();
		this.pageIndex = pageFormat.getPageIndex();
		this.rows = rows;
		if(pageIndex == this.totalPages) {
			hasNextPage = false;
		}
	}

	public PageResult(){
	}

	public int getPageIndex() {
		return pageIndex;
	}
	public int getTotalPages() {
		return totalPages;
	}
	public List<?> getRows() {
		return rows;
	}
	public boolean isHasNextPage() {
		return hasNextPage;
	}

	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	
	
}
